// pages/user/erji//registerBrand/registerBrand.js
Page({

  /**
   * 页面的初始数据
   */
  data: {
    brandName:'',
    jianjie:'',
    lianxiren:'',
    mobile:'',
    address:'',
    detailAddress:'',
    hangye:'',
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {

  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {

  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {

  },
  bindTelTag: function (e) {
    this.setData({
      mobile: e.detail.value
    })
  },
  bindNamePut: function (e) {
    this.setData({
      brandName: e.detail.value
    })
  },
  bindjianjie: function (e) {
    this.setData({
      jianjie: e.detail.value
    })
  },
  bindSHRTag: function (e) {
    this.setData({
      lianxiren: e.detail.value
    })
  },
  bindDetalAddTag: function (e) {
    this.setData({
      detailAddress: e.detail.value
    })
  },
  bindHangyeTag: function (e) {
    this.setData({
      hangye: e.detail.value
    })
  },
  /**
   * 选择地址
   */
  selectAddressTap: function () {
    this.setData({
      showSSQ:true,
    })
  },

  // 弹出框控制
  onClose() {
    this.setData({
      showSSQ: false,
    });
  },
  // 省市区选择确认
  onSsqConfirm(event) {
    const { values, indexs } = event.detail;
    var ssq="";
    for (var i = 0; i < values.length;i++){
      ssq+=(values[i].name+' ');
    }
    this.setData({
      address:ssq,
      // proviceCode:values[0].code,
      // cityCode: values[1].code,
      // areaCode: values[2].code,
      // provice: values[0].name,
      // city: values[1].name,
      // area: values[2].name,
    });
    this.onClose();
  },
})